<template>
  <div class="example">
    <div class="part">
      <div class="title">
        <span class="number">6</span>
        <span class="name titleName">API- Unauthorized: Authorization error</span>
      </div>
      <div class="cont">
        API response with unauthorized sample.
      </div>
      <div class="json">
        <div style="margin-top: 10px">
          <pre>{{ResponseData.json}}</pre>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "Example",
    data() {
      return {
        tableData1: [{
          FieldName: 'Grant Type',
          FieldDefinition: 'grant_type',
          FieldType: 'String',
          Comments: 'default value: client_credentials',
        }, {
          FieldName: 'Consumer Key',
          FieldDefinition: 'ConsumerKey',
          FieldType: 'String',
          Comments: 'Consumer Key assigned by Lenovo API Admin',
        }, {
          FieldName: 'Consumer Secret',
          FieldDefinition: 'ConsumerSecret',
          FieldType: 'String',
          Comments: 'Consumer Secret assigned by Lenovo API Admin',
        }, {
          FieldName: 'Content-Type',
          FieldDefinition: 'application/x-www-form-urlencoded',
          FieldType: 'String',
          Comments: 'Content-Type is set in http header',
        },
          {
            FieldName: 'Authorization',
            FieldDefinition: 'ConsumerKey:ConsumerSecret',
            FieldType: 'String',
            Comments: 'Content-Type is set in http header Sample:Authorization lLQnUaRRmXerDb9PDtz8QRYNfxAa : o9qmPJDlzXVdmyIm1pQf1hZqkqIa',
          }],
        tableData2: [{
          FieldName: 'Authorization Scope',
          FieldDefinition: 'scope',
          FieldType: 'String',
          Comments: 'Default',
        }, {
          FieldName: 'Token Type',
          FieldDefinition: 'token_type',
          FieldType: 'String',
          Comments: 'Default: Bearer',
        }, {
          FieldName: 'Token Expire time',
          FieldDefinition: 'expires_in',
          FieldType: 'Integer',
          Comments: 'Default: 3600 seconds',
        }, {
          FieldName: 'Access Token',
          FieldDefinition: 'access_token',
          FieldType: 'String',
          Comments: 'This token will be expired per 3600 seconds',
        },
          {
            FieldName: 'Authorization',
            FieldDefinition: 'ConsumerKey:ConsumerSecret',
            FieldType: 'String',
            Comments: 'Content-Type is set in http header Sample:Authorization lLQnUaRRmXerDb9PDtz8QRYNfxAa : o9qmPJDlzXVdmyIm1pQf1hZqkqIa',
          }],
        RequestData: {
          url: 'https://soa-test.lenovo.com/api/oauth2/token',
          http: 'Authorization:',

        },
        ResponseData:{
          json:`<ams:fault xmlns:ams="http://wso2.org/apimanager/security">
    <ams:code>900902</ams:code>
    <ams:message>Missing Credentials</ams:message>
    <ams:description>Required OAuth credentials not provided. Make sure your API invocation call has a header: "Authorization: Bearer ACCESS_TOKEN"</ams:description>
</ams:fault> `
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
  .example {
    margin: 10px 41px 0 41px;
    .part {
      margin: 30px 0;
      .title {
        margin: 10px;
        font-weight: bold;
        .number {
          font-size: 20px;
          color: #0090e9;
          margin-right: 10px;
        }
        .name {
          font-size: 20px;
          color: #000;
        }
        .titleName {
          font-size: 24px;
        }
      }
      .cont {
        font-size: 16px;
        line-height: 24px;
      }
      .json {
        .url {
          color: #0090e9;
          cursor: pointer;
        }
        .url:hover {
          text-decoration: underline;
        }
        .title{
          font-weight: bold;
        }
        span{
          display: block;
          margin-left: 10px;
        }
      }
      .table1 {
        width: 1142px;
      }
      .table2 {
        width: 880px;
      }
    }
  }

</style>
